/**
 * 
 */
package fr.cie.blog.controller;

import java.util.List;

import fr.cie.blog.beans.Interest;
import fr.cie.blog.domainservice.IServiceInterest;

/**
 * @author Jee3
 * 
 */
public class InterestAction extends GenericAction {

	/**
	 * serialVersionUID.
	 */
	private static final long serialVersionUID = 1568350985431062486L;
	/**
	 * interest.
	 */
	private Interest interest;
	/**
	 * interestList.
	 */
	private List<Interest> interestList;

	/**
	 * serviceInterest.
	 */
	private IServiceInterest serviceInterest;

	/**
	 * Constructor.
	 * 
	 * @param pServiceInterest
	 *            serviceInterest
	 */
	public InterestAction(final IServiceInterest pServiceInterest) {
		super();
		serviceInterest = pServiceInterest;
	}

	/**
	 * @return the interest
	 */
	public final Interest getInterest() {
		return interest;
	}

	/**
	 * @return the interestList
	 */
	public final List<Interest> getInterestList() {
		return interestList;
	}

	/**
	 * @return the serviceInterest
	 */
	public final IServiceInterest getServiceInterest() {
		return serviceInterest;
	}

	/**
	 * @param pinterest
	 *            the interest to set
	 */
	public final void setInterest(final Interest pinterest) {
		interest = pinterest;
	}

	/**
	 * @param pInterestList
	 *            the interestList to set
	 */
	public final void setInterestList(final List<Interest> pInterestList) {
		interestList = pInterestList;
	}

	/**
	 * @param pServiceInterest
	 *            the serviceInterest to set
	 */
	public final void setServiceInterest(
			final IServiceInterest pServiceInterest) {
		serviceInterest = pServiceInterest;
	}

	/**
	 * @return SUCCESS
	 */
	public final String showInterestList() {
		interestList = serviceInterest.findAll();
		return SUCCESS;
	}

	/**
	 * @return SUCCESS
	 */
	public final String addInterest() {
		serviceInterest.save(interest);
		return SUCCESS;
	}
}
